'use strict';

const Controller = require('egg').Controller;

class HomeController extends Controller {
  async index() {
    const { ctx } = this;
    ctx.body = 'hi, world';
  }
  async list(){
      const {ctx} = this;
      let listData = await this.app.mysql.query('select * from userlist');
      ctx.body = {
          code:1,
          data:listData
      }
  }
  async login(){
    const {ctx} = this;
    ctx.body = ctx.request.body;
  }
}

module.exports = HomeController;

